file(GLOB CPPFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.cpp")
message(STATUS "CPPFILES = ${CPPFILES}")
foreach(cppfile ${CPPFILES})
    string(REPLACE ".cpp" "" cppfile_basename ${cppfile})
    add_executable(${cppfile_basename} ${cppfile})    
    target_link_libraries(${cppfile_basename} pthread m)
    install(TARGETS ${cppfile_basename})
endforeach()
